import React, {Component, PureComponent} from 'react';
import {
    View, Text, Image,
    StyleSheet, Dimensions
} from 'react-native';

const {width: screenWidth} = Dimensions.get('window');

export default class ListItem extends Component {
    shouldComponentUpdate (np, ns) {
        return false;
    }
    render () {
        const {item} = this.props;
        return (
            <View style={this.props.style}>
                <Image 
                    style={styles.image}
                    source={{uri: item.imgUrl}}
                />
                <Text
                    numberOfLines={1}
                >
                    {item.title}
                </Text>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
    },
    image: {
        width: screenWidth / 2 - 10,
        height: screenWidth / 2 - 10,
        // width: 200,
        // height: 200,
        borderRadius: 5,
    },
});